struct buffer_st {
	void *address;

    int fd; 					//log.txt descriptor
	unsigned long size;			//size of buffer
	unsigned long write_offset;	//where to write data
};

int buffer_create(struct buffer_st *buffer, unsigned long size, int fd);
void buffer_free(struct buffer_st *buffer); //call this function before desstroying the buffer;
void buffer_clear(struct buffer_st *buffer);
void buffer_flush(struct buffer_st *buffer);
unsigned long buffer_count_size(struct buffer_st *buffer);
unsigned long buffer_count_free_size(struct buffer_st *buffer);
int bufferoverflow(unsigned long offset);
int buffer_write_message(struct buffer_st *buffer, char *message, int length);

